<?php

namespace App\Http\Controllers\Testing;

use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\DB;

class LotteryAddUsersController extends Controller
{

    public function index()
    {

        $all = $this->all;

        $number = $all['number'];

        for ($i = 0; $i < $number; $i++) {

            $openid = mt_rand(100000,999999);
            DB::table('lottery_users')
                ->insert([
                    'openid'=>$openid,
                    'nickname'=>'虚拟用户'.$openid,
                    'sex'=>2,
                    'language'=>'zh_CN',
                    'country'=>'中国',
                    'headimgurl'=>'http://thirdwx.qlogo.cn/mmopen/ajNVdqHZLLBia4icBY1zntWrQYCBqYqZROpeu8mZiay5wgGYzbl0PaVKEOBQ4FMwIv54G1ibswEiaH6SZEsjTnd1doA/132',
                    'subscribe_time'=> date('Y-m-d H:i:s'),
                ]);

        }

        return $this->setReturnJson(0,'success');


    }

}
